package cn.liukuan.jps.utils;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;

/**
 * Created by liukuan on 16/5/29.
 */
public class WebClientUtils {

    public static WebClient getWebClient(){

        WebClient  webClient=new WebClient(BrowserVersion.CHROME, "103.231.66.49", 80);

        webClient.getOptions().setThrowExceptionOnScriptError(false);
        webClient.setJavaScriptTimeout(10000);
        webClient.getOptions().setJavaScriptEnabled(true);
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());
        webClient.getOptions().setTimeout(10000);



        return webClient;

    }

}
